import java.util.Scanner;

public class Main {

    //异或和之和
    //给定一串整数，求他们两两异或和之和
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[n + 1];
        int[] sum = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            a[i] = scan.nextInt();
            sum[i] = sum[i - 1] ^ a[i];
        }

        long ans = 0;
        for (int i = 1; i <= n ; i++) {
            for (int j = i; j <= n ; j++) {
                ans += sum[j] ^ sum[i - 1];
            }
        }
        System.out.println(ans);
    }
}
